function setTimes(){
	var d = new Date();
	var year = d.getFullYear()+"年";
	var month = addZero(d.getMonth())+"月";
	var date = addZero(d.getDate())+"日";
	var week = "&nbsp;星期"+toWeek(d.getDay())+"&nbsp;";
	var hours = d.getHours()+":";
	var mins = addZero(d.getMinutes())+":";
	var secs = addZero(d.getSeconds());
	var times = year+month+date+week+hours+mins+secs;
	$("#times").html(times);
}
function addZero(data){
	if(data<10){
		data="0"+data;
	}
	return data;
}
function toWeek(data){
	switch(data){
		case 1:return "一";
		case 2:return "二";
		case 3:return "三";
		case 4:return "四";
		case 5:return "五";
		case 6:return "六";
		case 7:return "日";
	}
}



function initMenu(data){
	var menu = "";
	$.each(data, function(i,n) {//i是次数，n是当i=0，i=1……得到的值
		var menulist = '<div class="menuDiv"><span class="'+n.icon+'">&nbsp;&nbsp;&nbsp;</span><span>'+n.name+'</span>';
		menulist+='<ul>';
		//判断是否有子菜单
		$.each(n.children,function(j,o){//j是次数，o是当j=0，j=1……得到的值addTabs('部门名称','icon-cut','test.html')
			//menulist += '<li><div><a rel="'+o.name+'" href="javascript:void(0)" ref="'+o.urlCode+'" icon="'+o.icon+'"><span class="'+o.icon+'">&nbsp;&nbsp;&nbsp;&nbsp;</span><span class="nav">'+o.name+'</span></a></div></li>';
			menulist += '<li><div class="div" onclick="addTabs(\''+o.name+'\',\''+o.icon+'\',\''+o.urlCode+'\')" onmouseover="this.className=\'mhover\'" onmouseout="this.className=\'div\'"><a><span class="'+o.icon+'">&nbsp;&nbsp;&nbsp;</span><span>'+o.name+'</span></a></div></li>';
		});
		menulist += '</ul></div>';
		menu+=menulist;
	});
	$("#menu").html(menu);
}

